//用trait特性作为函数参数的类型

mod person;

fn main() {
    f_s(Person::new());
    person::person::new();

}
fn f_s(p: impl Person2) {
    println!("{:?} 打印出来", p.show(10));
}

trait Person2 {
    fn new() -> Self;
    fn show(&self, i: i32) -> i32;
}
trait Person4 {
    fn t() -> Self;
    fn dead(i: String) -> String;
}
struct Person {}
impl Person2 for Person {
    fn new() -> Self {
        Person {}
    }
    fn show(&self, i: i32) -> i32 {
        i
    }
}
